/*
** 3032.c
** 
** Made by (seakage2h)
** Login   <seakage2h@seakage2h-ubuntu>
** 
** Started on  Fri Oct  3 15:11:40 2008 seakage2h
** Last update Sun May 12 01:17:25 2002 Speed Blue
*/

/* #include "3032.h" */
#include <stdio.h>

int main()
{
     int instance, n;
     char i, index, stock[13], c;
     
     scanf("%d", &instance);

     while(instance){
	  scanf("%d", &n);
	  for(i = 0; i < n; i++)
	       stock[i] = 0;
	  index = -1;
	  for(i = 1; i <= n; i++){
	       c = 0;
	       while(c <= i){
		    if (index + 1 == n)
			 index = 0;
		    else index++;
		    if (!stock[index])
			 c++;
	       }
	       stock[index] = i;
	  }
	  for(i = 0; i < n - 1; i++)
	       printf("%d ", stock[i]);
	  printf("%d\n", stock[i]);
	  
	  instance--;
     }

     return 0;
}

